#!/usr/bin/env python
# -*- coding=utf-8 -*-

from faker import Faker,Factory
import xlwt


f=Faker(locale='zh_cn')

ws=xlwt.Workbook()
shet=ws.add_sheet(u'大数据')
path=r"D:\大数据.xls"
n=0

j = 0
while j <=10:
    #shet.write(n,j,'ID')
    shet.write(n,j,'姓名')#第一个参数表示行，第二个表示列,第三个自己需要的数据
    shet.write(n,j+1,'手机')
    shet.write(n,j+2,'ID')
    shet.write(n,j+3,'公司邮箱')
    shet.write(n,j+4,'公司')
    shet.write(n,j+5,'工作')
    shet.write(n,j+6,'文本')
    shet.write(n,j+7,'SSn')
    shet.write(n,j+8,'邮政编码')
    shet.write(n,j+9,'年份')        
    j += 10
    
#ws.save(path)

while n<=100000:
    n+=1
        
    j = 0
    while j <=10:
        shet.write(n,j,f.name())#第一个参数表示行，第二个表示列,第三个自己需要的数据
        shet.write(n,j+1,f.phone_number())
        shet.write(n,j+2,str(n))
        shet.write(n,j+3,f.company_email())
        shet.write(n,j+4,f.bs())
        shet.write(n,j+5,f.job())
        shet.write(n,j+6,f.text())
        shet.write(n,j+7,f.ssn())
        shet.write(n,j+8,f.postcode())
        shet.write(n,j+9,f.date(pattern="%Y-%m-%d", end_datetime=None))
        j += 10
    print('保存第'+ str(n) + '行')
    ws.save(path)
    

